$(document).ready(function() {
    $("#submit").click(function(){
        var formdata = new FormData($("#addForm")[0]);
        $.ajax({
            type:"POST",
            dataType:"json",
            url:"/shop-api/userInfo/insert",
            data:formdata,
            async:false,
            cache:false,
            contentType:false,
            processData:false,
            success:function(resp){
                if(resp.code==0){
                    window.location.href = "/shop-center/userCenter.html";
                }else {
                    alert("失败")
                }
            }
        })

    })
})
// 用户信息回显
$(document).ready(function () {
    let sessionUserJson = sessionStorage.getItem("login_user");
    let sessionUser = JSON.parse(sessionUserJson);
    $("#phone").attr("value",sessionUser.phone);
    $("#email").attr("value",sessionUser.email);
    $("#birthday").attr("value",sessionUser.birthday);
    $("#signature").attr("value",sessionUser.signature);
})